home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / mac / Chapter Tutorials / ch07.Authoring / CommandDemos / simpleplayer.dir / 00006_scripts.txt < prev    next >
Encoding:
Text File  |  1996-11-11  |  1.2 KB  |  46 lines

  1. -- the following script is in the Play/Pause button
  2.  
  3. on mouseUp
  4.   global gSWAStatus,gSWAFlag,gSWAFile
  5.   if gSWAFile <> the text of field "argument" then
  6.     stop (member "SWAHolder")
  7.     set gSWAFile = the text of field "argument" 
  8.     set the URL of member "SWAHolder" = gSWAFile
  9.   end if
  10.               if (gSWAstatus <= 2) or (gSWAstatus = 4) then
  11.                     play (member "SWAHolder")
  12.               else if gSWAstatus = 3 then
  13.                     pause (member "SWAHolder")
  14.       end if
  15. end
  16.  
  17. -- the next one is in the Stop button
  18. on mouseUp
  19.       stop (member "SWAHolder")
  20. end
  21.  
  22.  
  23. -- next are some important movie scripts
  24. -- the globals are declared at the top of the movie script,
  25. -- so they are not repeated in the handlers
  26.  
  27. on idle
  28.       if gSWAflag = 1 then checkSWA "SWAholder"
  29. end
  30.  
  31. on checkSWA membername
  32.       set gSWAstatus = the state of member membername
  33.       if gSWAstatus = 2 then
  34.             -- the SWA is ready to play
  35.       else if gSWAstatus = 3 then
  36.             updateTimeBar (the percentPlayed of member membername) 
  37.       else if gSWAstatus = 5 then
  38.             updateTimeBar 100
  39.             set gSWAflag = 0
  40.       else if gSWAstatus = 9 then
  41.             set errorCode = getError(member membername)
  42.             set errorString = getErrorString(member membername)
  43.             debug errorCode,errorString
  44.             set gSWAflag = 0
  45.       end if
  46. end